package com.k.base.jdk.thread.callable;

import java.util.concurrent.Callable;

/**
 * @author kivil
 */
public class TaskOne implements Callable<String> {
    private long delayTime;
    private String param;
    private String tName;

     TaskOne(String param,String tName,long delayTime){
        this.param = param;
        this.tName = tName;
        this.delayTime = delayTime;
    }
    @Override
    public String call() throws Exception {
        System.out.println("run:"+tName);
         /*if("ljw3".equals(param)){
             throw new Exception("gaga");
         }*/
         Thread.sleep(delayTime);
         Thread.currentThread().setName(tName);
         return  System.currentTimeMillis()+":"+Thread.currentThread() + ": hello "+ param;

    }
}
